# -*- coding: utf-8 -*-
# Author:叶海波

import configparser

cfg1 = "test_cfg.ini"

conf = configparser.ConfigParser()
# E:/PycharmProjects/jsjj/jsjj/mouseKeyboard
# E:/PycharmProjects/jsjj/jsjj/util/configuration.ini
conf.read('../../../util/configuration.ini', encoding='utf-8')

# 读取ini文件中的内容
print(conf.get("priority", "currentPriority"))


# print conf.get("Account information","username")
# print conf.items("Account information")  #获取到Account information中的所有内容，返回字典类型
# print conf.options("Account information")   #获取到Account information中的变量名
#
# #向ini中添加内容
# print conf.add_section("Account")
# print conf.set("Account","title","1")
# print conf.write(open("test_cfg.ini","w+"))
#
# #向ini中修改内容
# conf.set("Account","title","6")
# conf.write(open("test_cfg.ini","w+"))
def getIni(section, key):
    # 支持逗号分割的
    return conf.get(section, key)

def getcurrentPriority():
    # 支持逗号分割的
    return conf.get("priority", "currentPriority").split(',')

def getdownloadFilePath():
    # 有些网站抓取，是通过文件名称拉抓取的
    return conf.get("system", "downloadFilePath")
